import { Form, Root, Textarea } from 'native-base';
import React from 'react';
import { ActivityIndicator, ScrollView, Text, TouchableOpacity, View } from 'react-native';
export default function tpl(a: <T>(action: string, ...args: unknown[]) => ((...args: unknown[]) => void), s: (...class_names: string[]) => {}, d: (d: string) => string | unknown[]) {

	const dataArray = d('data') as Array<{ student_no: string; student_name: string; auditor_status: string; start_time_str: string; finish_time_str: string; leave_days: number; leave_content: string; }>;
	const teacher_name = d('teacher_name');
	const btns = d('btns');
	if (dataArray) {
		return (<View style={s('page')}>
			<ScrollView style={s('zong')}>
				<View style={s('top1', 'mt20')}>
					<Text style={s('toptext1')}>{dataArray[0].student_name}</Text>
					<Text style={s('toptext2')}>{dataArray[0].auditor_status}</Text>
				</View>
				<Root></Root>
				<View style={s('top1')}>
					<View style={s('row')}>
						<Text style={s('text1')}>开始时间：</Text>
						<Text style={s('text2')}>{dataArray[0].start_time_str}</Text>
					</View>
					<View style={s('row')}>
						<Text style={s('text1')}>结束时间：</Text>
						<Text style={s('text2')}>{dataArray[0].finish_time_str}</Text>
					</View>
					<View style={s('row')}>
						<Text style={s('text1')}>时长（天）：</Text>
						<Text style={s('text2')}>{dataArray[0].leave_days}</Text>
					</View>
					<View style={s('row')}>
						<Text style={s('text1')}>请假事由：</Text>
						<Text style={s('text2')}>{dataArray[0].leave_content}</Text>
					</View>
					<View style={s('row')}>
						<Text style={s('text1')}>审核人：</Text>
						<Text style={s('text2')}>{teacher_name}</Text>
					</View>
				</View>
				<View style={s('zbot')}>
					<Text style={s('text3')}><Text style={{ color: 'red' }}>*</Text>审核意见</Text>
					<Form >
						<Textarea rowSpan={4} placeholder="请输入请假事由" onFocus={a('a002', 'focue')} onBlur={a('a002', 'blur')} onChangeText={a('a002', 'changeText')} />
					</Form>
				</View>
			</ScrollView>
			<View style={s('bottom')}>
				<View style={s('bottom1')}>
					{(() => {
						if (btns === '1') {
							return (
								<View style={s('bottom')}>
									{/* <TouchableOpacity> */}
									<Text style={s('btns1')}>同意</Text>
									{/* </TouchableOpacity> */}
									{/* <TouchableOpacity> */}
									<Text style={s('btns1', 'btns2')}>不同意</Text>
									{/* </TouchableOpacity> */}
								</View>
							);
						} else if (btns === '2') {
							return (
								<View style={s('bottom')}>
									<TouchableOpacity onPress={a('a003')}>
										<Text style={s('btn1')}>同意</Text>
									</TouchableOpacity>
									<TouchableOpacity onPress={a('a004')} >
										<Text style={s('btn1', 'btn2')}>不同意</Text>
									</TouchableOpacity>
								</View>
							);
						}
					})()}

				</View>
			</View>
		</View>);
	} else {
		return (
			<View style={s('footer1')}>
				<ActivityIndicator />
				<Text>正在加载数据...</Text>
			</View>
		);
	}

}
